<?php
/**
 * Notes:
 * User:ZSLAA
 * DateTime: 2020/10/29 11:08
 */


namespace app\admin\validate;
use think\Validate;
class Admin extends Validate
{
    protected $rule = [
        'username'  =>'require|max:20',
        'password'  =>'require|max:30|min:5',
        'captcha'          =>'require',
    ];

    protected $message = [
        'username.require' =>'用户名不能为空',
        'username.max'     =>'用户名不能超过20个字符',
        'password.require' =>'登入密码不能为空',
        'password.max'     =>'密码长度超出限制',
        'password.min'     =>'密码长度小于限制',
        'captcha.require'  =>'验证码不能为空',
    ];

    protected $scene = [
        'login'  =>  ['username','password','captcha'],
    ];


}